// src/mock.js
const Mock = require('mockjs')
const Random = Mock.Random



const getName = () => {     //模拟数据 ,
 let data = []

 data.push(
 {
  "id": "1",
  "image":"https://img1.baidu.com/it/u=3518470917,2846010073&fm=253&fmt=auto&app=138&f=JPEG?w=640&h=468",
  "name":"时令水果"
 },
 {
  "id": "1",
  "image":"https://img2.baidu.com/it/u=393810117,3156444385&fm=253&fmt=auto&app=138&f=JPEG?w=334&h=500",
  "name":"新鲜蔬菜"
 },
 {
  "id": "1",
  "image":"https://img0.baidu.com/it/u=4052552074,3424995867&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500",
  "name":"海鲜水产"
 },
 {
  "id": "1",
  "image":"https://img1.baidu.com/it/u=4265294313,3864351030&fm=253&fmt=auto&app=138&f=JPEG?w=706&h=452",
  "name":"素食冷冻"
 },
 {
  "id": "1",
  "image":"https://img0.baidu.com/it/u=4060456887,2678050899&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=333",
  "name":"肉禽蛋品"
 },
 {
  "id": "1",
  "image":"https://img0.baidu.com/it/u=776287319,1361798917&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1664298000&t=87c1bbac6158e2db240fe83371c8a2b3",
  "name":"量贩特惠"
 },
 {
  "id": "1",
  "image":"http://t15.baidu.com/it/u=697872271,3765149102&fm=224&app=112&f=JPEG?w=375&h=500",
  "name":"基地鲜花"
 },
 {
  "id": "1",
  "image":"https://img1.baidu.com/it/u=425937462,3234782905&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=667",
  "name":"美妆百货"
 },
 {
  "id": "1",
  "image":"https://img1.baidu.com/it/u=376891129,3473459478&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=422",
  "name":"母婴保健"
 },
 {
  "id": "1",
  "image":"https://img2.baidu.com/it/u=3603297652,1411316524&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=334",
  "name":"进口酒饮"
 },
 )
 return data
}

Mock.mock('http://localhost:8080/getResource/getData', 'get', getName())

const getName2 = () => {
 let data = []

 data.push(
 {
  "id": "1",
  "name":"好吃点",
  "desc":"广东白糖罂荔枝试吃",
  "image1":"https://img1.baidu.com/it/u=992955374,3177959976&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1664298000&t=752ad018bc4a8558b7993f293007512e",
  "image2":"https://img2.baidu.com/it/u=1957537027,2132236722&fm=253&app=138&size=w931&n=0&f=PNG&fmt=auto?sec=1664298000&t=6103f89fa695e0f79bd50d2cc1625306"
 },
 {
  "id": "1",
  "name":"产地量贩",
  "desc":"红心火龙果五元一个",
  "image1":"https://img1.baidu.com/it/u=1451984436,2208832660&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1664298000&t=8abe742efa35707451d897b54ceb447b",
  "image2":"https://img1.baidu.com/it/u=3239866294,4236326069&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1664298000&t=b426ae94f840f4b7369998472435e373"
 }
 )
 return data
}

Mock.mock('http://localhost:8080/getResource/getData2', 'get', getName2())

const swiper = () => {
 let data = []

 data.push(
 {
  "id": "1",
  "image2":"https://img0.baidu.com/it/u=4189327847,1916791189&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=334"
 },
 {
  "id": "1",
  "image2":"https://img1.baidu.com/it/u=2067519793,1538879631&fm=253&fmt=auto&app=138&f=JPEG?w=480&h=300"
 }
 ,
 {
  "id": "1",
  "image2":"https://img2.baidu.com/it/u=2279765317,1470963163&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=265"
 }
 ,
 {
  "id": "1",
  "image2":"https://img2.baidu.com/it/u=3244238158,4275891579&fm=253&fmt=auto&app=138&f=JPEG?w=625&h=500"
 }
 )
 return data
}

Mock.mock('http://localhost:8080/getResource/swiper', 'get', swiper())

const password = () => {
 let data =[1,3,9,6,2,7]
 return data
}

Mock.mock('http://localhost:8080/getResource/password', 'get', password())